#ifndef STATE_MANAGER_H
#define STATE_MANAGER_H

#include <functional>
#include <vector>
#include "..\Generic\GameTime.h"

class State;
class StateManager
{
public:
	static StateManager& getSingleton();
	static void clean();

	void setState(State* p_state);
	void pushState(State* p_state);
	void popState();
	void start();
	void shutdown() { m_run = false; }

private:
	StateManager();
	virtual ~StateManager();

	static StateManager* m_instance;

	void clear();
	bool m_run;
	std::vector<State*> m_states;
	std::vector<std::function<void()>> m_stack;
};

#endif //STATE_MANAGER_H